import type {ReactNode} from "react";
import type {UseFetchDataAction} from "@ant-design/pro-table/es/typing";
import {RequestSuccessLog} from "@/pages/system/tool/requestLog/interfaces";
import type {ProColumns} from "@ant-design/pro-table";
import {Button, Space} from "antd";


// @ts-ignore
const columns: ProColumns<RequestSuccessLog> = () => {
  return [
    {
      dataIndex: "index",
      valueType: "index",
    },
    {
      title: "请求接口",
      dataIndex: "requestUri",
      align: 'center',
      hideInSearch: true,
    },
    {
      title: "控制器类名称",
      dataIndex: "className",
      align: 'center',
      hideInSearch: true,
    },
    {
      title: "请求执行方法",
      dataIndex: "methodName",
      align: 'center',
      hideInSearch: true,
    },
    {
      title: "响应时间",
      dataIndex: "time",
      align: 'center',
      hideInSearch: true,
    },
    {
      title: "操作",
      valueType: 'option',
      align: "center",
      key: "option",
      width: "200px",
      render: (text: ReactNode, record: RequestSuccessLog, index: number, action: UseFetchDataAction<RequestSuccessLog>) => {
        return (
          <Space>
            <Button type={"link"}>查看</Button>
          </Space>
        )
      }
    }
  ]


}


export default columns;
